package com.ewing.extranal.im;

import java.util.concurrent.ConcurrentHashMap;

/**
 * IM连接池
 * 
 * @author tansonlam
 * @createDate 2016年4月22日
 * 
 */
public class ImConnectionPool {
    private static final ConcurrentHashMap<Long, ImMessageWebSocket> connections = new ConcurrentHashMap<Long, ImMessageWebSocket>();

    public static void add2Pool(Long imUserId, ImMessageWebSocket imMessageExchanger) {
        connections.put(imUserId, imMessageExchanger);
    }

    public static void remove(Long imUserId) {
        connections.remove(imUserId);
    }

    public static ImMessageWebSocket get(Long imUserId) {
        return connections.get(imUserId);
    }
}
